<?php

namespace app\admin\service\statistics\datatable\core;

use app\admin\service\statistics\datatable\AbstractQueryStatistician;
use app\admin\service\statistics\traits\CompletionTrait;
use app\admin\service\statistics\traits\FilterTrait;
use app\admin\service\statistics\traits\GrouperCreatedToDateTrait;
use app\common\model\AccessLog;
use app\common\model\Consulting;


/**
 *
 * Class ConsultingPaidCount
 * @package app\admin\service\statistics\datatable\core
 */
class ConsultingPaidCount extends AbstractQueryStatistician
{
    // 筛选器
    use FilterTrait;

    // 分组器
    use GrouperCreatedToDateTrait;

    // 补齐
    use CompletionTrait;

    protected function getQuery()
    {
        return Consulting::field(['count(*)' => 'value'])
            ->where('consultingType', '1')
            ->whereIn('status', ['1', '2']);
    }

    protected function getDefaultValue()
    {
        return '0';
    }
}